home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tcl8.0 / win / makefile.vc < prev    next >
Encoding:
Makefile  |  1997-08-15  |  10.2 KB  |  378 lines  |  [TEXT/ALFA]

  1. # Visual C++ 2.x and 4.0 makefile
  2. #
  3. # See the file "license.terms" for information on usage and redistribution
  4. # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  5. # Copyright (c) 1995-1996 Sun Microsystems, Inc.
  6. # SCCS: @(#) makefile.vc 1.80 97/08/13 13:30:36
  7.  
  8. # Does not depend on the presence of any environment variables in
  9. # order to compile tcl; all needed information is derived from 
  10. # location of the compiler directories.
  11.  
  12. #
  13. # Project directories
  14. #
  15. # ROOT    = top of source tree
  16. #
  17. # TMPDIR  = location where .obj files should be stored during build
  18. #
  19. # TOOLS32 = location of VC++ 32-bit development tools. Note that the
  20. #        VC++ 2.0 header files are broken, so you need to use the
  21. #        ones that come with the developer network CD's, or later
  22. #        versions of VC++.
  23. #
  24. # TOOLS16 = location of VC++ 1.5 16-bit tools, needed to build thunking
  25. #        library.  This information is optional; if the 16-bit compiler
  26. #        is not available, then the 16-bit code will not be built.  
  27. #        Tcl will still run without the 16-bit code, but...
  28. #        A. Under Windows 3.X you will any calls to the exec command
  29. #               will return an error.
  30. #        B. A 16-bit program to test the behavior of the exec
  31. #           command under NT and 95 will not be built.
  32. #
  33.  
  34. ROOT        = ..
  35. TMPDIR        = .
  36. TOOLS32        = c:\msdev
  37. TOOLS16        = c:\msvc
  38.  
  39. # Set this to the appropriate value of /MACHINE: for your platform
  40. MACHINE    = IX86
  41.  
  42. # Comment the following line to compile with symbols
  43. NODEBUG=1
  44.  
  45. # uncomment one of the following lines to compile with TCL_MEM_DEBUG, 
  46. # TCL_MEM_DEBUG, or TCL_COMPILE_DEBUG
  47. #DEBUGDEFINES    = -DTCL_MEM_DEBUG
  48. #DEBUGDEFINES    = -DTCL_MEM_DEBUG -DTCL_COMPILE_DEBUG
  49. #DEBUGDEFINES    = -DTCL_MEM_DEBUG -DTCL_COMPILE_STATS
  50. #DEBUGDEFINES    = -DTCL_MEM_DEBUG -DTCL_COMPILE_DEBUG -DTCL_COMPILE_STATS
  51.  
  52. ######################################################################
  53. # Do not modify below this line
  54. ######################################################################
  55.  
  56. VERSION = 80
  57.  
  58. TCLLIB        = tcl$(VERSION).lib
  59. TCLDLL        = tcl$(VERSION).dll
  60. TCLPLUGINLIB    = tcl$(VERSION)p.lib
  61. TCLPLUGINDLL    = tcl$(VERSION)p.dll
  62. TCL16DLL    = tcl16$(VERSION).dll
  63. TCLSH        = tclsh$(VERSION).exe
  64. TCLSHP        = tclshp$(VERSION).exe
  65. TCLTEST        = tcltest.exe
  66. DUMPEXTS    = $(TMPDIR)\dumpexts.exe
  67. TCLPIPEDLL    = tclpip$(VERSION).dll
  68. TCLREGDLL    = tclreg$(VERSION).dll
  69. CAT16        = cat16.exe
  70. CAT32        = cat32.exe
  71.  
  72. TCLSHOBJS = \
  73.     $(TMPDIR)\tclAppInit.obj
  74.  
  75. TCLTESTOBJS = \
  76.     $(TMPDIR)\tclTest.obj \
  77.     $(TMPDIR)\tclTestObj.obj \
  78.     $(TMPDIR)\tclWinTest.obj \
  79.     $(TMPDIR)\testMain.obj
  80.  
  81. TCLOBJS = \
  82.     $(TMPDIR)\panic.obj \
  83.     $(TMPDIR)\regexp.obj \
  84.     $(TMPDIR)\strftime.obj \
  85.     $(TMPDIR)\tclAlloc.obj \
  86.     $(TMPDIR)\tclAsync.obj \
  87.     $(TMPDIR)\tclBasic.obj \
  88.     $(TMPDIR)\tclBinary.obj \
  89.     $(TMPDIR)\tclCkalloc.obj \
  90.     $(TMPDIR)\tclClock.obj \
  91.     $(TMPDIR)\tclCmdAH.obj \
  92.     $(TMPDIR)\tclCmdIL.obj \
  93.     $(TMPDIR)\tclCmdMZ.obj \
  94.     $(TMPDIR)\tclCompExpr.obj \
  95.     $(TMPDIR)\tclCompile.obj \
  96.     $(TMPDIR)\tclDate.obj \
  97.     $(TMPDIR)\tclEnv.obj \
  98.     $(TMPDIR)\tclEvent.obj \
  99.     $(TMPDIR)\tclExecute.obj \
  100.     $(TMPDIR)\tclFCmd.obj \
  101.     $(TMPDIR)\tclFileName.obj \
  102.     $(TMPDIR)\tclGet.obj \
  103.     $(TMPDIR)\tclHash.obj \
  104.     $(TMPDIR)\tclHistory.obj \
  105.     $(TMPDIR)\tclIndexObj.obj \
  106.     $(TMPDIR)\tclInterp.obj \
  107.     $(TMPDIR)\tclIO.obj \
  108.     $(TMPDIR)\tclIOCmd.obj \
  109.     $(TMPDIR)\tclIOSock.obj \
  110.     $(TMPDIR)\tclIOUtil.obj \
  111.     $(TMPDIR)\tclLink.obj \
  112.     $(TMPDIR)\tclListObj.obj \
  113.     $(TMPDIR)\tclLoad.obj \
  114.     $(TMPDIR)\tclMain.obj \
  115.     $(TMPDIR)\tclNamesp.obj \
  116.     $(TMPDIR)\tclNotify.obj \
  117.     $(TMPDIR)\tclObj.obj \
  118.     $(TMPDIR)\tclParse.obj \
  119.     $(TMPDIR)\tclPipe.obj \
  120.     $(TMPDIR)\tclPkg.obj \
  121.     $(TMPDIR)\tclPosixStr.obj \
  122.     $(TMPDIR)\tclPreserve.obj \
  123.     $(TMPDIR)\tclProc.obj \
  124.     $(TMPDIR)\tclStringObj.obj \
  125.     $(TMPDIR)\tclTimer.obj \
  126.     $(TMPDIR)\tclUtil.obj \
  127.     $(TMPDIR)\tclVar.obj \
  128.     $(TMPDIR)\tclWin32Dll.obj \
  129.     $(TMPDIR)\tclWinChan.obj \
  130.     $(TMPDIR)\tclWinError.obj \
  131.     $(TMPDIR)\tclWinFCmd.obj \
  132.     $(TMPDIR)\tclWinFile.obj \
  133.     $(TMPDIR)\tclWinInit.obj \
  134.     $(TMPDIR)\tclWinLoad.obj \
  135.     $(TMPDIR)\tclWinMtherr.obj \
  136.     $(TMPDIR)\tclWinNotify.obj \
  137.     $(TMPDIR)\tclWinPipe.obj \
  138.     $(TMPDIR)\tclWinSock.obj \
  139.     $(TMPDIR)\tclWinTime.obj 
  140.  
  141. cc32        = $(TOOLS32)\bin\cl.exe
  142. link32        = $(TOOLS32)\bin\link.exe
  143. rc32        = $(TOOLS32)\bin\rc.exe
  144. include32    = -I$(TOOLS32)\include
  145.  
  146. cc16        = $(TOOLS16)\bin\cl.exe
  147. link16        = $(TOOLS16)\bin\link.exe
  148. rc16        = $(TOOLS16)\bin\rc.exe
  149. include16    = -I$(TOOLS16)\include
  150.  
  151. WINDIR          = $(ROOT)\win
  152. GENERICDIR    = $(ROOT)\generic
  153.  
  154. TCL_INCLUDES    = -I$(WINDIR) -I$(GENERICDIR)
  155. TCL_DEFINES    = -D__WIN32__ $(DEBUGDEFINES)
  156.  
  157. TCL_CFLAGS    = $(cdebug) $(cflags) $(cvarsdll) $(include32) \
  158.             $(TCL_INCLUDES) $(TCL_DEFINES)
  159. CON_CFLAGS    = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
  160. DOS_CFLAGS    = $(cdebug) $(cflags) $(include16) -AL 
  161. DLL16_CFLAGS    = $(cdebug) $(cflags) $(include16) -ALw
  162.  
  163. ######################################################################
  164. # Link flags
  165. ######################################################################
  166.  
  167. !IFDEF NODEBUG
  168. ldebug = /RELEASE
  169. !ELSE
  170. ldebug = -debug:full -debugtype:cv
  171. !ENDIF
  172.  
  173. # declarations common to all linker options
  174. lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
  175.  
  176. # declarations for use on Intel i386, i486, and Pentium systems
  177. !IF "$(MACHINE)" == "IX86"
  178. DLLENTRY = @12
  179. lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
  180. !ELSE
  181. lflags   = $(lcommon) /MACHINE:$(MACHINE)
  182. !ENDIF
  183.  
  184. conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
  185. guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
  186. dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
  187.  
  188. !IF "$(MACHINE)" == "PPC"
  189. libc = libc.lib
  190. libcdll = crtdll.lib
  191. !ELSE
  192. libc = libc.lib oldnames.lib
  193. libcdll = msvcrt.lib oldnames.lib
  194. !ENDIF
  195.  
  196. baselibs   = kernel32.lib $(optlibs) advapi32.lib user32.lib
  197. winlibs    = $(baselibs) gdi32.lib comdlg32.lib winspool.lib
  198.  
  199. guilibs       = $(libc) $(winlibs)
  200. conlibs       = $(libc) $(baselibs)
  201. guilibsdll = $(libcdll) $(winlibs)
  202. conlibsdll = $(libcdll) $(baselibs)
  203.  
  204. ######################################################################
  205. # Compile flags
  206. ######################################################################
  207.  
  208. !IFDEF NODEBUG
  209. cdebug = -Ox
  210. !ELSE
  211. cdebug = -Z7 -Od -WX
  212. !ENDIF
  213.  
  214. # declarations common to all compiler options
  215. ccommon = -c -W3 -nologo -YX -Dtry=__try -Dexcept=__except
  216.  
  217. !IF "$(MACHINE)" == "IX86"
  218. cflags = $(ccommon) -D_X86_=1
  219. !ELSE
  220. !IF "$(MACHINE)" == "MIPS"
  221. cflags = $(ccommon) -D_MIPS_=1
  222. !ELSE
  223. !IF "$(MACHINE)" == "PPC"
  224. cflags = $(ccommon) -D_PPC_=1
  225. !ELSE
  226. !IF "$(MACHINE)" == "ALPHA"
  227. cflags = $(ccommon) -D_ALPHA_=1
  228. !ENDIF
  229. !ENDIF
  230. !ENDIF
  231. !ENDIF
  232.  
  233. cvars      = -DWIN32 -D_WIN32
  234. cvarsmt    = $(cvars) -D_MT
  235. cvarsdll   = $(cvarsmt) -D_DLL
  236.  
  237. ######################################################################
  238. # Project specific targets
  239. ######################################################################
  240.  
  241. release:    $(TCLSH) dlls
  242. dlls:        $(TCL16DLL) $(TCLPIPEDLL) $(TCLREGDLL)
  243. all:        $(TCLSH) dlls $(CAT16) $(CAT32) 
  244. tcltest:    $(TCLTEST) dlls $(CAT16) $(CAT32)
  245. plugin:        $(TCLPLUGINDLL) $(TCLSHP)
  246. test:        $(TCLTEST) dlls $(CAT16) $(CAT32) 
  247.     $(TCLTEST) <<
  248.         cd ../tests
  249.         source all
  250. <<
  251.  
  252. $(DUMPEXTS): $(WINDIR)\winDumpExts.c
  253.     $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
  254.     set LIB=$(TOOLS32)\lib
  255.     $(link32) $(ldebug) $(conlflags) $(guilibs) -out:$@ \
  256.         $(TMPDIR)\winDumpExts.obj 
  257.  
  258. $(TCLLIB): $(TCLDLL)
  259.  
  260. $(TCLDLL): $(TCLOBJS) $(TMPDIR)\tcl.def $(TMPDIR)\tcl.res
  261.     set LIB=$(TOOLS32)\lib
  262.     $(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\tcl.def \
  263.         -out:$@ $(TMPDIR)\tcl.res $(guilibsdll) @<<
  264. $(TCLOBJS)
  265. <<
  266.  
  267. $(TCLPLUGINLIB): $(TCLPLUGINDLL)
  268.  
  269. $(TCLPLUGINDLL): $(TCLOBJS) $(TMPDIR)\plugin.def $(TMPDIR)\tcl.res
  270.     set LIB=$(TOOLS32)\lib
  271.     $(link32) $(ldebug) $(dlllflags) -def:$(TMPDIR)\plugin.def \
  272.         -out:$@ $(TMPDIR)\tcl.res $(guilibsdll) @<<
  273. $(TCLOBJS)
  274. <<
  275.  
  276. $(TCLSH): $(TCLSHOBJS) $(TCLLIB) $(TMPDIR)\tclsh.res
  277.     set LIB=$(TOOLS32)\lib
  278.     $(link32) $(ldebug) $(conlflags) $(TMPDIR)\tclsh.res \
  279.         -out:$@ $(conlibsdll) $(TCLLIB) $(TCLSHOBJS) 
  280.  
  281. $(TCLSHP): $(TCLSHOBJS) $(TCLPLUGINLIB) $(TMPDIR)\tclsh.res
  282.     set LIB=$(TOOLS32)\lib
  283.     $(link32) $(ldebug) $(conlflags) $(TMPDIR)\tclsh.res \
  284.         -out:$@ $(conlibsdll) $(TCLPLUGINLIB) $(TCLSHOBJS) 
  285.  
  286. $(TCLTEST): $(TCLTESTOBJS) $(TCLLIB) $(TMPDIR)\tclsh.res
  287.     set LIB=$(TOOLS32)\lib
  288.     $(link32) $(ldebug) $(conlflags) $(TMPDIR)\tclsh.res -stack:1572864 \
  289.          -out:$@ $(conlibsdll) $(TCLLIB) $(TCLTESTOBJS)
  290.  
  291. $(TCL16DLL):  $(WINDIR)\tcl16.rc $(WINDIR)\tclWin16.c
  292.     if exist $(cc16) $(cc16) @<<
  293. $(DLL16_CFLAGS) -Fo$(TMPDIR)\ $(WINDIR)\tclWin16.c
  294. <<                         
  295.     @copy << $(TMPDIR)\tclWin16.def > nul
  296. LIBRARY $(@B);dll
  297. EXETYPE WINDOWS
  298. CODE PRELOAD MOVEABLE DISCARDABLE
  299. DATA PRELOAD MOVEABLE SINGLE
  300. HEAPSIZE 1024 
  301. EXPORTS
  302.     WEP @1 RESIDENTNAME
  303.     UTPROC @2 
  304. << 
  305.     if exist $(cc16) $(link16) /NOLOGO /ONERROR:NOEXE /NOE @<<
  306. $(TMPDIR)\tclWin16.obj
  307. $@
  308. nul
  309. $(TOOLS16)\lib\ ldllcew oldnames libw toolhelp
  310. $(TMPDIR)\tclWin16.def
  311. <<
  312.     if exist $(cc16) $(rc16) -i $(GENERICDIR) $(TCL_DEFINES) $(WINDIR)\tcl16.rc $@
  313.  
  314. $(TCLPIPEDLL): $(WINDIR)\stub16.c
  315.     $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $(WINDIR)\stub16.c
  316.     set LIB=$(TOOLS32)\lib
  317.     $(link32) $(ldebug) $(conlflags) -out:$@ $(TMPDIR)\stub16.obj $(guilibs)
  318.  
  319. $(TCLREGDLL): $(TMPDIR)\tclWinReg.obj
  320.     set LIB=$(TOOLS32)\lib
  321.     $(link32) $(ldebug) $(dlllflags) -out:$@ $(TMPDIR)\tclWinReg.obj \
  322.         $(conlibsdll) $(TCLLIB)
  323.  
  324. $(CAT32): $(WINDIR)\cat.c
  325.     $(cc32) $(CON_CFLAGS) -Fo$(TMPDIR)\ $?
  326.     set LIB=$(TOOLS32)\lib
  327.     $(link32) $(conlflags) -out:$@ -stack:16384 $(TMPDIR)\cat.obj $(conlibs)
  328.  
  329. $(CAT16): $(WINDIR)\cat.c
  330.     if exist $(cc16) $(cc16) $(DOS_CFLAGS) -Fo$(TMPDIR)\ $?
  331.     set LIB=$(TOOLS16)\lib
  332.     if exist $(cc16) $(link16) /NOLOGO /ONERROR:NOEXE /NOI /STACK:16384 \
  333.         $(TMPDIR)\cat.obj,$@,nul,llibce.lib,nul
  334.  
  335. $(TMPDIR)\tcl.def: $(DUMPEXTS) $(TCLOBJS)
  336.     $(DUMPEXTS) -o $@ $(TCLDLL) @<<
  337. $(TCLOBJS)
  338. <<
  339.  
  340. $(TMPDIR)\plugin.def: $(DUMPEXTS) $(TCLOBJS)
  341.     $(DUMPEXTS) -o $@ $(TCLPLUGINDLL) @<<
  342. $(TCLOBJS)
  343. <<
  344.  
  345. #
  346. # Special case object file targets
  347. #
  348.  
  349. $(TMPDIR)\testMain.obj: $(WINDIR)\tclAppInit.c
  350.     $(cc32) $(TCL_CFLAGS) -DTCL_TEST -Fo$(TMPDIR)\testMain.obj $?
  351.  
  352. #
  353. # Implicit rules
  354. #
  355.  
  356. {$(WINDIR)}.c{$(TMPDIR)}.obj:
  357.     $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $<
  358.  
  359. {$(GENERICDIR)}.c{$(TMPDIR)}.obj:
  360.     $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $<
  361.  
  362. {$(ROOT)\compat}.c{$(TMPDIR)}.obj:
  363.     $(cc32) $(TCL_CFLAGS) -Fo$(TMPDIR)\ $<
  364.  
  365. {$(WINDIR)}.rc{$(TMPDIR)}.res:
  366.     $(rc32) -fo $@ -r -i $(GENERICDIR) -i $(WINDIR) -D__WIN32__ \
  367.         $(TCL_DEFINES) $<
  368.  
  369. clean:
  370.         -@del *.exp 
  371.     -@del *.lib 
  372.     -@del *.dll 
  373.     -@del *.exe
  374.         -@del $(TMPDIR)\*.obj
  375.         -@del $(TMPDIR)\*.res
  376.         -@del $(TMPDIR)\*.def
  377.